package com.googlecode.recycled.lang.jse.api.zip;

import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang.UnhandledException;

import java.io.File;
import java.io.IOException;
import java.util.zip.ZipFile;

public class ZipArchive {

    protected final File file;

    public ZipArchive(File file) {
        this.file = file;
    }

    public void unzip(File baseDirectory) {
        try {
            Zips.unzip(new ZipFile(file), baseDirectory);
        } catch (IOException e) {
            throw new UnhandledException(e);
        }
    }

    public void unzip() {
        unzip(SystemUtils.getUserDir());
    }

}
